package com.itheima.Demo01.demo02;

import java.util.ArrayList;
import java.util.Arrays;

public class toArray {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("qqq");
        list.add("哇哇哇");
        list.add("嗯嗯嗯");
        list.add("热热热");

        Object[] objects = list.toArray();
        System.out.println(Arrays.toString(objects));
        System.out.println("-------------");

        String[] strings = list.toArray(new String[list.size()]);
        System.out.println(Arrays.toString(strings));
    }
}
